﻿using Microsoft.Extensions.Configuration;
using MiniFox.Configurations;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OSS.AliyunCloud.Configurations
{
    public class BucketSetting
    {
        [ConfigurationKeyName("name")]
        public string Name { get; set; }

        [ConfigurationKeyName("endpoint")]
        public string Endpoint { get; set; }

        [ConfigurationKeyName("region")]
        public string Region { get; set; }

        [ConfigurationKeyName("accessKeyId")]
        public string AccessKeyId { get; set; }

        [ConfigurationKeyName("accessKeySecret")]
        public string AccessKeySecret { get; set; }
    }

    public class BucketSettingCollection : KeyedCollection<string, BucketSetting>
    {
        public BucketSettingCollection() { }

        protected override string GetKeyForItem(BucketSetting item)
        {
            return item.Name;
        }
    }
}
